package com.lin.fengxiu.vo;

import com.lin.fengxiu.model.Category;
import com.lin.fengxiu.model.Coupon;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName CouponCategoryVO
 * @Description TODO
 * @Author wushaopei
 * @Date 2021/4/1 23:15
 * @Version 1.0
 */
@Setter
@Getter
public class CouponCategoryVO  extends CouponPureVO{

    private List<CategoryPureVO> categories = new ArrayList<>();

    public CouponCategoryVO(Coupon coupon){
        super(coupon);
        List<Category> categories = coupon.getCategoryList();
        categories.forEach(category -> {
            CategoryPureVO vo = new CategoryPureVO(category);
            this.categories.add(vo);
        });
    }
}
